<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    #box{
      width: 200px;
      height: 200px;
      background-color: rgb(211, 24, 24);
      margin: 100px auto;
    }
  </style>
</head>
<body>
  <div id="app">
    <button @click="change">显示</button>
    <div id="box" v-if="isShow">111</div>
    <div id="box" v-show="isShow">222</div>
  </div>
  <script src="./vue.js"></script>
  <script>
    var a = 10;
    const vm = new Vue({
      el: '#app',
      data: {
        isShow: false
      },
      methods: {
        change(){
          this.isShow = !this.isShow;
        }
      }
    })
    // btn.addEventListener('事件',回调函数,[false/true])
  </script>
</body>
</html>